x86/shadow: Fix #PFs from emulated writes crossing a page boundary
authorAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 25 Nov 2016 17:23:04 +0000 (17:23 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 2 Dec 2016 17:23:01 +0000 (17:23 +0000)
commitf600fa5345d008ec686bfe2c579bbb37b11c7972
treedfd38f2e63588ee2bfe7f343f7ca0bf76da8c0c0
parent295f4c8bc2e6da4a4442efa115da4e1b393b3672
x86/shadow: Fix #PFs from emulated writes crossing a page boundary

When translating the second frame of a write crossing a page boundary, mask
the linear address down to the page boundary.

This causes the correct %cr2 being reported to the guest in the case that the
second frame suffers a pagefault during translation.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Tim Deegan <tim@xen.org>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/mm/shadow/common.c